﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for Task
/// </summary>
public class Task
{
	public Task()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public DataTable GetTasks(String SqlString)
    {
        DataTable t = new DataTable();
        string connectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
        string RetrieveSql = SqlString;

        using (SqlConnection myConnection = new SqlConnection(connectionString))
        {
            using (SqlDataAdapter a = new SqlDataAdapter(RetrieveSql, connectionString))
            {           
                a.Fill(t);
            }
            myConnection.Close();
        }
        return t;

    }
}